package com.xujicheng.designpattern.learn.simpleFactory;

/**
 * 披萨门店
 * @project:design-pattern-learn
 * @package:com.xujicheng.designpattern.learn.simpleFactory
 * @author:xujicheng
 * @date:2018/8/7
 */
public class PizzaStore {
    private SimplePizzaFactory factory;
    public PizzaStore(SimplePizzaFactory factory){
        this.factory = factory;
    }

    public Pizza orderPizza(String type){
        System.out.println("披萨门店接到一笔订单，想要的披萨类型："+type);
        Pizza pizza = factory.createPizza(type);
        pizza.prepare();
        pizza.bake();
        pizza.cut();
        pizza.box();
        return pizza;
    }
}
